package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Journal generated by hbm2java
 */
@Entity
@Table(name = "journal")
public class Journal implements java.io.Serializable {

	private Long id;
	private UserBaseInfo userBaseInfo;
	private String journalizedTable;
	private long journalizedId;
	private String note;
	private Date createDate;
	private Set<JournalDetail> journalDetails = new HashSet<JournalDetail>(0);

	public Journal() {
	}

	public Journal(UserBaseInfo userBaseInfo, String journalizedTable,
			long journalizedId, Date createDate) {
		this.userBaseInfo = userBaseInfo;
		this.journalizedTable = journalizedTable;
		this.journalizedId = journalizedId;
		this.createDate = createDate;
	}

	public Journal(UserBaseInfo userBaseInfo, String journalizedTable,
			long journalizedId, String note, Date createDate,
			Set<JournalDetail> journalDetails) {
		this.userBaseInfo = userBaseInfo;
		this.journalizedTable = journalizedTable;
		this.journalizedId = journalizedId;
		this.note = note;
		this.createDate = createDate;
		this.journalDetails = journalDetails;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID", nullable = false)
	public UserBaseInfo getUserBaseInfo() {
		return this.userBaseInfo;
	}

	public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
		this.userBaseInfo = userBaseInfo;
	}

	@Column(name = "JOURNALIZED_TABLE", nullable = false, length = 50)
	public String getJournalizedTable() {
		return this.journalizedTable;
	}

	public void setJournalizedTable(String journalizedTable) {
		this.journalizedTable = journalizedTable;
	}

	@Column(name = "JOURNALIZED_ID", nullable = false)
	public long getJournalizedId() {
		return this.journalizedId;
	}

	public void setJournalizedId(long journalizedId) {
		this.journalizedId = journalizedId;
	}

	@Column(name = "NOTE", length = 65535)
	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_DATE", nullable = false, length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "journal")
	public Set<JournalDetail> getJournalDetails() {
		return this.journalDetails;
	}

	public void setJournalDetails(Set<JournalDetail> journalDetails) {
		this.journalDetails = journalDetails;
	}

}
